home *** CD-ROM | disk | FTP | other *** search
/ Danny Amor's Online Library / Danny Amor's Online Library - Volume 1.iso / html / faqs / faq / compilers-faq < prev    next >
Encoding:
Text File  |  1995-07-25  |  22.6 KB  |  473 lines

  1. Subject: comp.compilers monthly message and Frequently Asked Questions
  2. Newsgroups: comp.compilers,news.answers,comp.answers
  3. From: compilers-request@iecc.com (John R. Levine)
  4. Date: Tue, 1 Nov 1994 12:00:03 GMT
  5.  
  6. Archive-name: compilers-faq
  7.  
  8. This is the comp.compilers monthly message, last edited November 1994.
  9.  
  10. Contents:
  11.  
  12. -- What is comp.compilers?
  13. -- How do I receive it?
  14. -- How do I submit a message?
  15. -- What happens to submitted messages?
  16. -- How do I respond to the author of a message?
  17. -- How do I contact the moderator?
  18. -- Are back issues available?
  19.  
  20. -- Some Frequently Asked Questions:
  21.  
  22. * Where can I get a C or C++ grammar in yacc?
  23. * Where can I get the Gnu C compiler?
  24. * Are there other free C compilers?
  25. * Where can I get a Fortran grammar in yacc or a Fortran compiler?
  26. * Where can I get Modula-2, Pascal, Ada, or SQL grammars in yacc?
  27. * Where can I get a Cobol grammar in yacc?
  28. * Where can I get a Basic grammar in yacc?
  29. * Where can I get a PL/M grammar?
  30. * Are there free versions of yacc and lex ?
  31. * Are there versions of yacc and lex for MS-DOS?
  32. * What other compilers and tools are freely available?
  33. * How can I get started with yacc and lex and compiler writing in general?
  34. * Where can I FTP the sources to the programs in Holub's "Compiler
  35.   Design in C" or Mak's "Writing Compilers and Interpreters" ?
  36.  
  37. -- What is comp.compilers?
  38.  
  39. It is a moderated usenet news group addressing the topics of compilers in
  40. particular and programming language design and implementation in general.
  41. It started in 1986 as a moderated mailing list, but interest quickly grew to
  42. the point where it was promoted to a news group.  Recent topics have
  43. included optimization techniques, language design issues, announcements of
  44. new compiler tools, and book reviews.
  45.  
  46. Messages come from a wide variety of people ranging from undergraduate
  47. students to well-known experts in industry and academia.  Authors live all
  48. over the world -- there are regular messages from the U.S, Canada, Europe,
  49. Australia, and Japan, with occasional ones from as far away as Malaysia.
  50. I cannot tell how large the readership is, since the anarchic nature of
  51. usenet makes it impossible to tell who reads it, but a reasonable guess is
  52. that the total is over 100,000, which would make it by far the most widely
  53. read medium on the topic in the world.
  54.  
  55. Unless there is specific language to the contrary, each message represents
  56. only the personal opinion of its author.  I claim no compilation copyright on
  57. comp.compilers.  As far as I am concerned, anyone can reproduce any message
  58. for any purpose.  Individual authors may retain rights to their messages,
  59. although I will not knowingly post anything that does not permit unlimited
  60. distribution in any form.  If you find comp.compilers useful in writing a
  61. book, producing a product, etc., I would appreciate an acknowledgement of
  62. usenet and comp.compilers.
  63.  
  64. -- How do I receive it?
  65.  
  66. The easiest way is to read comp.compilers on a system that gets usenet news.
  67.  
  68. If you don't have access to usenet news, it's also available via E-mail via
  69. a LISTSERV forwarder at the American University.  To subscribe a person
  70. should send e-mail to listserv@american.edu with one line in the mail
  71. message (not in the subject!)  That line should read:
  72.  
  73.                         SUBSCRIBE COMPIL-L full_name
  74. for example:
  75.                         SUBSCRIBE COMPIL-L Ima Hacker
  76.  
  77. To get off the list the subscriber should send e-mail to the same address
  78. with the message:       SIGNOFF COMPIL-L
  79.  
  80. If you have problems getting on or off the list, please contact me.  In
  81. particular, if you want to use an address other than your own personal mail
  82. address, you have to ask me to set it up.  If I receive bounce messages for
  83. an address on the mailing list for two days in a row, I delete it.  If this
  84. happens to you and your address subsequently becomes reachable again, you
  85. can resubscribe.
  86.  
  87. -- How do I submit a message?
  88.  
  89. Mail it to compilers@iecc.com.  I review messages nearly every day,
  90. usually including weekends, and most messages are posted to the net within
  91. a day after I receive them.  Occasionally when I go on vacation there may
  92. be up to a week's delay, though I try to send out a message when that will
  93. happen.
  94.  
  95. Most net news systems will automatically turn posted messages into mail to
  96. compilers, but some, particularly systems running notes, don't do that
  97. correctly.  As a result, I sometimes receive hundreds of copies of a
  98. message, all mangled slightly differently.  Please mail your contributions
  99. unless you're sure your posting software works correctly.
  100.  
  101. When you send a message to compilers, I understand that to mean that you
  102. want me to post it to usenet, which means it will be sent to tens of
  103. thousands of potential readers at thousands of computers all around the
  104. world.  It may also appear in a printed comp.compilers annual and other
  105. books, in printed journals, in on-line and off-line archives, CD-ROMs, and
  106. anywhere else that some reader decides to use it.
  107.  
  108. If you don't want me to post something, send it instead to
  109. compilers-request.  (See below.)
  110.  
  111. PLEASE: Format messages with lines of less than 80 characters, since many
  112. news readers (including mine) don't auto-wrap very well.  Also remove quoted
  113. material not immediately germane to your response.  Messages must be in plain
  114. ASCII, not TeX input, troff, SGML, RTF or any other markup language.
  115.  
  116. -- What happens to submitted messages?
  117.  
  118. Barring mail problems, they arrive in a special mailbox here at iecc.  I
  119. then edit the headers, trim down quoted text, fix typos and grammatical
  120. errors, remove cute signatures, and then post them to usenet.  If I think a
  121. message needs more editing than that, I return it to the author for
  122. rewriting.  The main reasons I return a message are that it appears more
  123. appropriate for another group, the message is too garbled to fix, it
  124. contains too much quoted material relative to the amount of new material, or
  125. I don't understand it.  I also usually return messages that directly attack
  126. individuals, since the net has plenty of other places for ad-hominem battles.
  127. Another possibility is that a message doesn't have a valid return e-mail
  128. address.  If your mail system insists on putting a bogus address in the From:
  129. line, be sure that you put a usable address in your signature.
  130.  
  131. If a message asks a simple question I sometimes answer it myself rather than
  132. posting it.  When two or three messages arrive with the same answer to a
  133. question, I usually post only one of them, with a comment crediting the
  134. others.
  135.  
  136. If you send in a message and don't either see it posted or receive
  137. something back in a few days, it probably got lost in the mail and you
  138. should contact me, preferably via a different mail route.  I post or
  139. respond to all messages except for ones that appear to have been sent by
  140. mistake, e.g. no contents, contents consisting only of another quoted
  141. message, or a personal message for the author of a previous message.
  142. Sometimes when I'm feeling exasperated I disregard messages that re-ask
  143. one of the frequently asked questions that are answered below.
  144.  
  145. One of the most time-consuming jobs in moderating the group is trimming down
  146. the quotes in followup articles.  In most cases, you can expect readers to
  147. have seen the previous article, so only a few lines of quoted text should be
  148. needed to remind the reader of the context.
  149.  
  150. I have installed a simple-minded quote filter that mechanically returns to
  151. the sender any message that contains more quoted than unquoted lines.  Please
  152. edit your quotes before you send in a response, to avoid having the filter
  153. bounce your message.  Since the quote filter is pretty dumb, I do look at
  154. bounced messages myself.  If the filter bounces a message of yours by mistake,
  155. don't panic -- it'll get posted anyway.
  156.  
  157. ``Help wanted'' and ``Position Available'' messages are collected each week
  158. and posted in a digest every Sunday.
  159.  
  160. -- How do I respond to the author of a message?
  161.  
  162. I try to be sure that every message contains valid From: and Reply-To:
  163. headers.  The automatic "reply" commands in most news readers let you send
  164. mail to the author.  If you're replying to a message in a digest, be sure
  165. to respond to the author of the particular message, not to the pseudo-author
  166. of the digest.
  167.  
  168. Some obsolete news readers attempt to reply using the Path: header, but for
  169. technical reasons the Path: header in a moderated message cannot point to
  170. the actual author.  In fact, the Path: header in a compilers message is
  171. deliberately a bad mail address, so if you have such a news reader you'll
  172. have to edit the addresses in responses yourself and, I hope, encourage your
  173. system manager to update your news and mail software.
  174.  
  175. Sometimes mail to an author bounces, either because a gateway isn't
  176. working or because the return address is unregistered or otherwise bad.
  177. Please don't ask me to forward it, since my machine is no better connected
  178. than anyone else's.  (It's just another node on the Internet.)  If
  179. you send me a message obviously intended for the author of an item, I will
  180. discard it on the theory that if it wasn't important enough for you to
  181. send it to the right place, it isn't important enough for me, either.
  182.  
  183. -- How do I contact the moderator?
  184.  
  185. Send me mail at compilers-request@iecc.com.  I treat messages to
  186. compilers-request as private messages to me unless they state that they
  187. are for publication.
  188.  
  189. -- Are back issues available?
  190.  
  191. I have complete archives going back to the original mailing list in 1986.
  192. The archives now fill about 18 megabytes, and are growing at over 200K per
  193. month.  I update the archives at the end of each month.  People with ftp
  194. access can get them from iecc.com, (140.186.81.1) in directory
  195. pub/articles.  The archives contain a gzipped Unix mailbox format file for
  196. each month, with names like 91-08.gz.  Directory pub/index contains index
  197. files, one for each year.  The current network software at iecc.com is buggy,
  198. so although FTP works, it can be excruciatingly slow.  The archives are
  199. updated every night.
  200.  
  201. The archives are available via modem from Channel One, an excellent local
  202. BBS.  You have to register, but no payment is needed to download the
  203. archives which are in Area 6.  (If you call more than once or twice, it
  204. would be nice to sign up for at least the $25 trial membership.)  The 2400
  205. BPS telephone number is +1 617 354 8873, and the Telebit number is +1 617
  206. 354 0470.  There is a ZIP format archive per month with names like
  207. comp9108.zip, with the most recent archive also containing the index.
  208.  
  209. There is now a mail server at compilers-server@iecc.com that can mail you
  210. indexes, messages, and the files mentioned below.  Send it a message
  211. containing "help" to get started.
  212.  
  213. I have also published a printed edition of the 1990 messages grouped by
  214. thread and topic, and with some indexes, and may publish subsequent
  215. editions.  (If you'd be intereted in editing books for later years, let me
  216. know.)  See the message which should immediately follow this one for
  217. further details on the 1990 book. 
  218.  
  219. -- Some Frequently Asked Questions:
  220.  
  221. NOTE: Many issues are discussed occasionally on comp.compilers, but not
  222. frequently enought to make the FAQ sheet.  If you have a question but the
  223. answer isn't in the FAQ, you may well be able to get good background by
  224. reading the appropriate articles in the archive.  If you can FTP, please
  225. at least get the index and look through it.
  226.  
  227. The various files that I mention below that I have are in the compilers
  228. archive at iecc.com, and are also available from the mail server mentioned
  229. above.  If you can FTP them, please do so rather than using the mail
  230. server, since the mail bandwith is quite small.
  231.  
  232. * Where can I get a C or C++ grammar in yacc?
  233.  
  234. Jim Roskind's well-known C and C++ grammars are in the archive, as is
  235. a C grammar written by Jeff Lee.  Dave Jones posted a parser as
  236. message 91-09-030.  Another C grammar was posted to comp.sources.misc
  237. in June 1990, v13 i52, archive name ansi-c_su.  GCC and G++ are based
  238. on yacc grammars, see below.
  239.  
  240. * Where can I get the Gnu C compiler?
  241.  
  242. GCC is a high-quality free C and C++ compiler.  (Free is not the same as
  243. public domain, see the GCC distribution for details.)  It is available in
  244. source from prep.ai.mit.edu.  You need an existing C compiler and
  245. libraries to bootstrap it.
  246.  
  247. A development system called "djgpp" by DJ Delorie <dj@ctron.com> is based
  248. on gcc and other GNU programs, and runs on 386 or higher PCs running
  249. MS-DOS.  This is available by FTP from the SimTel archives (primary mirror
  250. is oak.oakland.edu) in the directory pub/msdos/djgpp.
  251.  
  252. * Are there other free C compilers?
  253.  
  254. The lcc compiler, written by people at Princeton and Bell Labs, is
  255. available via FTP from ftp.cs.princeton.edu in /pub/lcc.  It is supposed
  256. to generate code nearly as good as GCC while being considerably faster and
  257. smaller.  It comes with a demonstration VAX code generator and
  258. documentation on the code generation interfaces.  Production code
  259. generators for the VAX, MIPS, and Motorola 68020 are available for
  260. research use to universities willing to execute a license agreement; the
  261. FTP package elaborates.  Lcc uses a hard-coded C parser because it's
  262. faster than yacc.
  263.  
  264. * Where can I get a Fortran grammar in yacc or a Fortran compiler?
  265.  
  266. I have a small subset parser in the archive at iecc.com.  The F2C
  267. Fortran to C translator is a respectable Fortran system (so long as
  268. you have a C compiler to compile its output and its libraries) and
  269. contains a full F77 parser and is available in source form via FTP
  270. from netlib.att.com and by mail from netlib@research.att.com.
  271.  
  272. * Where can I get Modula-2, Pascal, Ada, or SQL grammars in yacc?
  273.  
  274. I have one each of those, too, in the archive at iecc.com, though I
  275. haven't tried to use any of them.
  276.  
  277. * Where can I get a Cobol grammar in yacc?
  278.  
  279. Nowhere for free, as far as I can tell.  This question is asked every few
  280. months and there has never, ever, been any positive response. Perhaps some
  281. of the interested people could get together and write one.  The commercial
  282. PCYACC from Abraxas (see below) comes with a bunch of sample grammars
  283. including one for Cobol-85.
  284.  
  285. Also see the Cobol FAQ posted monthly to comp.lang.misc and alt.cobol.
  286.  
  287. * Where can I get a Basic grammar in yacc?
  288.  
  289. Take a look at ftp.uu.net:usenet/comp.sources.unix/volume2/basic which
  290. contains a Basic interpreter with yacc parser.
  291.  
  292. * Where can I get a PL/M grammar?
  293.  
  294. There's one in the archives at iecc.com, called plm.shar.  Also see message
  295. 94-03-062 for a report on a PL/M to C translator.
  296.  
  297. * Are there free versions of yacc and lex ?
  298.  
  299. Vern Paxton's flex is a superior reimplementation of lex.  It is available
  300. from the same places as Gnu sources, but is not subject to the Gnu
  301. copyleft.  Berkeley Yacc is a quite compatible PD version of yacc by Bob
  302. Corbett, available as ~ftp/pub/byacc.tar.Z on okeeffe.berkeley.edu.  Gnu
  303. Bison is derived from an earlier version of Corbett's work and is also
  304. fairly compatible with yacc.  A byacc extension that displays graphically
  305. the progress of a parse can be found in Jim Roskind's C++ grammar in the
  306. FTP compilers archive.  (The files are too big for the mail archive,
  307. sorry.)
  308.  
  309. * Are there versions of yacc and lex for MS-DOS?
  310.  
  311. There are several of them.  Commercial versions are MKS lex&yacc from MKS
  312. in Waterloo Ont., +1 519 884 2251 or inquiry@mks.com, and PCYACC from
  313. Abraxas Software in Portland OR, +1 503 244 5253.  Both include both yacc
  314. and lex along with a lot of sample code.
  315.  
  316. The standard flex source compiles under the usual DOS compilers, although
  317. you may want to make some of the buffers smaller.  A DOS version of Bison
  318. is on wuarchive.wustl.edu [128.252.135.4] and other servers under
  319. /mirrors/msdos/txtutl/bison111.zip. See message 92-07-012 for more info.
  320.  
  321. * What other compilers and tools are freely available?
  322.  
  323. There is a five-part FAQ posting in comp.compilers and other groups
  324. listing compiler tools freely available in source form, maintained by
  325. Steve Robenalt <free-compilers@idiom.berkeley.ca.us>.  It is posted
  326. monthly, usually right after this message.  If it's not on your system,
  327. you can FTP it from rtfm.mit.edu in the directory
  328. /pub/usenet/news.answers/free-compilers, or via mail by sending a message
  329. to to mail-server@rtfm.mit.edu with the command "send
  330. usenet/news.answers/free-compilers/*" in the text.
  331.  
  332. * How can I get started with yacc and lex and compiler writing in general?
  333.  
  334. By reading any of the many books on the topic.  Here are a few of them.
  335. Also see message 93-01-155 which reviews many compiler textbooks.
  336.  
  337. Aho, Sethi, and Ullman, "Compilers: Principles, Techniques, and Tools,"
  338. Addison Wesley, 1986, ISBN 0-201-10088-6, the "dragon book".
  339.  
  340. Describes clearly and completely lexing and parsing techniques including
  341. the ones in yacc and lex.  The authors work or have worked at Bell Labs
  342. with Steve Johnson and Mike Lesk, the authors of Yacc and Lex.
  343.  
  344. Alan Holub, "Compiler Design in C," Prentice-Hall, 1990, ISBN
  345. 0-13-155045-4.
  346.  
  347. A large book containing the complete source code to a reimplementation of
  348. yacc and lex and a C compiler.  Quite well written, too, though it has a
  349. lot of errors.  The fourth printing is supposed to correct most of them.
  350. An errata list is in message 90-06-081.
  351.  
  352. John R. Levine (that's me), Tony Mason, and Doug Brown, ``Lex & Yacc,''
  353. 2nd Edition, O'Reilly and Associates, 1992, ISBN 1-56592-000-7, $29.95.
  354.  
  355. A concise introduction with completely worked out examples and an
  356. extensive reference section.  The new edition is completely revised from
  357. the earlier 1990 edition.  Source code can be FTP'ed from ftp.ora.com.
  358.  
  359. Donnely and Stallman, "The Bison Manual," part of the on-line distrubution
  360. of the FSF's Bison, a reimplementation of yacc.  As with everything else from
  361. the FSF, full source code is included.
  362.  
  363. Axel T. Schreiner and H. George Friedman, Jr., "Introduction to Compiler
  364. Construction with UNIX," Prentice-Hall, 1985.
  365.  
  366. Oriented to tutorial work.  Good for beginners.  Develops a small
  367. subset-of-C compiler through the book.  (Recommended by Eric Hughes
  368. <hughes@ocf.Berkeley.EDU>.)  Richard Hash <rgh@shell.com> comments that
  369. the book has many typographical errors, and readers should be suspicious
  370. of the examples until they actually try them.  Richard Y. Kim
  371. <richard@ear.mit.edu> reports that sources are available for FTP as
  372. a.cs.uiuc.edu:pub/friedman/tar.
  373.  
  374. Bennett, J.P. "Introduction to Compiling Techniques - A First Course Using
  375. Ansi C, Lex and Yacc," McGraw Hill Book Co, 1990, ISBN 0-07-707215-4.
  376.  
  377. It's intended for a first course in modern compiler techniques, is very
  378. clearly written, and has a full chapter on YACC.  I found it to be a good
  379. introductory text before getting into the 'Dragon book'.  (Recommended by
  380. John Merlin <J.H.Merlin@ecs.southampton.ac.uk>.)  Source code is available
  381. at ftp.bath.ac.uk.
  382.  
  383. Charles N. Fischer & Richard J. LeBlanc, "Crafting A Compiler", Benjamin
  384. Cummings Publishing, Menlo Park, CA, 1988, ISBN 0-8053-3201-4.  There's
  385. also a revised version as of 1990 or 1991 titled "Crafting A Compiler in
  386. C", with all examples in C (the original used ADA/CS).
  387.  
  388. Erich Nahum <nahum@cs.umass.edu> writes: A key compiler reference.  We
  389. used the original to great effect in Eliot Moss' graduate compiler
  390. construction class here at UMass.  My feeling is that Fischer & LeBlanc is
  391. a good tutorial, and one should use Aho, Sethi, & Ullman as a reference.
  392.  
  393. Des Watson, "High-Level Languages and Their Compilers," International
  394. Computer Science Series, Addison-Wesley Publishing Company, Wokingham
  395. England, 1989.
  396.  
  397. Adrian Howard <adrianh@cogs.sussex.ac.uk> writes: This is the kindest,
  398. most readable introduction to compilers at the graduate level I have ever
  399. read - an excellent example of what textbooks should all be like.
  400.  
  401. W.M. Waite and G. Goos, "Compiler Construction," Springer-Verlag, New
  402. York, 1984.
  403.  
  404. Dick Grune <dick@cs.vu.nl> writes: A theoretical approach to compiler
  405. construction. Refreshing in that it gives a completely new view of many
  406. subjects. Heavy reading, high information density.
  407.  
  408. J.P. Tremblay and P.G. Sorenson, "The Theory and Practice of Compiler
  409. Writing," McGraw-Hill, 1985.
  410.  
  411. Dick Grune <dick@cs.vu.nl> writes: Extensive and detailed. Heavy reading.
  412. To be consulted when other sources fail.
  413.  
  414. James E. Hendrix, "The Small-C Compiler", 2nd ed., M&T Books, ISBN
  415. 0-934375-88-7 <Book Alone>, 1-55851-007-9 <MS-DOS Disk>, 0-934375-97-6
  416. <Book and Disk>.
  417.  
  418. William Jhun <ec_ind03@oswego.edu> writes: It explaines the C-language is
  419. thorough....and explains every single aspect of the compiler. The book
  420. compares source code to p-code to assembly. It goes over a nice set of
  421. optimization routines, explains the parser, the back end, and even
  422. includes source code, which the compiler on the disk can actually compile
  423. itself. It's an extremely interesting book, check it out.
  424.  
  425. Ronald Mak, "Writing Compilers and Interpreters: An Applied Approach",
  426. 1991, John Wiley and Sons, Inc. ISBN 0-471-50968-X.
  427.  
  428. Andrew Tucker <a_tucker@paul.spu.edu> writes: This 512-page book presents
  429. a strictly hands on approach, developing a Pascal interpreter and
  430. interactive debugger, then completing with a compiler which emits 8086
  431. assembly.  All source code is provided in print and on disk.  This book is
  432. very low to non-existent in theoretical content, but is very practical and
  433. readable for an introduction.  Taylor Hutt <thutt@access.digex.net>
  434. comments that the book is a piece of junk.  The code that is contained in
  435. the book is full of bugs, and the code that it generates will not work.
  436.  
  437. "The Art of Compiler Design", Thomas Pittman & James Peters, Prentice-Hall
  438. International, 1992, Englewood Cliffs, NJ 07632, 0-13-046160-1
  439.  
  440. Franklin L. Vermeulen <vfrank@vnet3.vub.ac.be> writes: This is a very
  441. nicely written and straightforward text on compiler construction.  There
  442. is a certain (unavoidable?) amount of overlap with a course on automata
  443. (as in Aho, Sethi and Ullman).  It is based on Modula-2 and on an
  444. experimental tool, the TAG compiler-compiler (Transformational Attribute
  445. Grammar) which seems to be a C-independent superset of lex/yacc, because
  446. its syntax allows you to specify all semantic actions without a single
  447. line of C-code (or any other implementation language, for that matter).
  448.  
  449. A. Pyster, "Compiler Design and Constuction (Tools and Techniques)",
  450. Second Ed., Van Nostrand Reinhold, ISBN: 0-442-27536-6.
  451.  
  452. Gabriela O. de Vivo <gdevivo@dino.conicit.ve> writes: The book covers the
  453. general principles of compiler design and presents a good number of
  454. examples focusing on the building of pieceparts of compilers for C and
  455. Pascal.  The implementation (construction) language is C.  Note that this
  456. edition (in contrast with the previous one) is very related to the Unix
  457. world, including the use of tools like Lex, Yacc, and standard utilities.
  458.  
  459. If anyone sends in others, I'll be happy to add them to the list.
  460.  
  461. * Where can I FTP the sources to the programs in Holub's "Compiler
  462. Design in C" or Mak's "Writing Compilers and Interpreters" ?
  463.  
  464. You can't.  In each book there's ordering information for diskettes with
  465. the code.
  466.  
  467. Regards,
  468. John Levine, comp.compilers moderator
  469. -- 
  470. Send compilers articles to compilers@iecc.com or
  471. {ima | spdcc | world}!iecc!compilers. Meta-mail to compilers-request@iecc.com.
  472.  
  473.